home *** CD-ROM | disk | FTP | other *** search
- 1000 ' OKIDATA 82A PRINTER CONFIGURATION PROGRAM (FOR IBM PC)
- 1010 ' (REQUIRES MS BASIC. ) 05/26/83 T.E.M. TAILORED FOR PC.
- 1020 '
- 1030 ' SKIP GILBRECH, (212)685-0551
- 1040 ' NOVEMBER 9, 1981
- 1050 '
- 1060 ' FOR THE OKIDATA 82A
- 1070 ' ADAPTED (FREELY) FROM AN MX80 PROGRAM
- 1080 ' (MX80FORM.BAS) COPYRIGHT (c)
- 1090 ' RODERICK WAYNE HART WA3MEZ
- 1100 ' JUNE 21, 1981
- 1110 '
- 1120 ' THIS PROGRAM IS NOT TO BE USED IN A COMMERCIAL ENVIRONMENT
- 1130 ' WITHOUT PROPER AUTHORIZATION.
- 1140 '
- 1150 ' ********** Define variables
- 1160 ESC$ = CHR$(27) 'escape command
- 1170 BEL$ = CHR$(7) 'bell command
- 1180 'CS$ = ESC$+"E" 'clear screen command
- 1190 EL$ = ESC$+"l" 'erase entire line command
- 1200 CU$ = ESC$+"A" 'cursor up one line command
- 1210 DC4$ = CHR$(20) 'loads vertical tab positions
- 1220 QU$ = CHR$(63) 'question mark - ends vert. tab loading
- 1230 RS$ = CHR$(30) 'designates 10 c.p.i.
- 1240 GS$ = CHR$(29) 'designates 16.5 c.p.i.
- 1250 US$ = CHR$(31) 'designates wider characters (x2)
- 1260 PL$ = ESC$+"F" 'designates page length
- 1270 TOF$ = ESC$+"5" 'sets top of form
- 1280 LL$ = ESC$+"A" 'designates long line (80 @ 10 c.p.i.)
- 1290 SL$ = ESC$+"B" 'designates short line (64 @ 10 c.p.i.)
- 1300 '
- 1310 ' ********** Print sign-on message
- 1320 CLS
- 1330 PRINT TAB(12) "OKIDATA 82A PRINTER CONFIGURATION PROGRAM"
- 1340 PRINT TAB(12) "*****************************************"
- 1350 PRINT : PRINT
- 1360 PRINT TAB(7) "When the printer is first turned on, it is set to 1/6 inch"
- 1370 PRINT TAB(7) "vertical spacing and 10 characters per inch horizontal."
- 1380 PRINT TAB(7) "If these values are OK, just leave things alone."
- 1390 PRINT TAB(7) "Make sure to turn the printer off and on to initialize it"
- 1400 PRINT TAB(7) "if you are setting, or have already set, vertical tabs."
- 1410 PRINT
- 1420 PRINT TAB(7); : INPUT "Press RETURN when you are ready. ",CR$
- 1430 ' ********** Print menu
- 1440 GOSUB 3610
- 1450 PRINT TAB(26) "MAIN MENU"
- 1460 PRINT TAB(26) "---------"
- 1470 PRINT : PRINT
- 1480 PRINT TAB(10) "1. Set line spacing"
- 1490 PRINT TAB(10) "2. Set vertical tabs"
- 1500 PRINT TAB(10) "3. Set page length"
- 1510 PRINT TAB(10) "4. Set top of form"
- 1520 PRINT TAB(10) "5. Set characters per inch"
- 1530 PRINT TAB(10) "6. Set line length"
- 1540 PRINT TAB(10) "7. Execute printer test"
- 1550 PRINT TAB(10) "8. Return to BASIC command level"
- 1560 PRINT TAB(10) "9. Exit this program."
- 1570 GOSUB 3660
- 1580 IF S% < 1 OR S% > 9 THEN GOSUB 3500 : GOTO 1440
- 1590 ON S% GOTO 1630,1820,2490,2740,2870,3070,3230
- 1600 IF S% = 8 THEN CLS: END
- 1610 IF S% = 9 THEN CLS: SYSTEM
- 1620 ' ********** Line spacing
- 1630 GOSUB 3610
- 1640 PRINT TAB(26) "LINE SPACING"
- 1650 PRINT TAB(26) "------------"
- 1660 PRINT : PRINT
- 1670 PRINT TAB(10) "1. 1/6 inch"
- 1680 PRINT TAB(10) "2. 1/8 inch"
- 1690 PRINT TAB(10) "3. Return to main menu"
- 1700 GOSUB 3660
- 1710 IF S% < 1 OR S% > 3 THEN GOSUB 3500 : GOTO 1630
- 1720 ON S% GOTO 1740,1780,1440
- 1730 ' ********** 1/6 inch line spacing
- 1740 LPRINT ESC$+"6" : PRINT
- 1750 PRINT TAB(10) "Line spacing set to 1/6 inch"
- 1760 GOTO 3460
- 1770 ' ********** 1/8 inch line spacing
- 1780 LPRINT ESC$+"8" : PRINT
- 1790 PRINT TAB(10) "Line spacing set to 1/8 inch"
- 1800 GOTO 3460
- 1810 ' ********** Set vertical tabs
- 1820 CLS
- 1830 PRINT TAB(26) "VERTICAL TABS"
- 1840 PRINT TAB(26) "-------------"
- 1850 TSP% = 0
- 1860 PRINT : PRINT
- 1870 PRINT TAB(10) "How many vertical tabs do you wish to set? (27 max.)"
- 1880 PRINT TAB(10); : INPUT "(Enter '0' to return to main menu) ",VTAB$
- 1890 IF VTAB$ = "0" THEN 1440
- 1900 IF LEN(VTAB$) > 2 THEN GOSUB 3500 : GOTO 1820
- 1910 VTAB% = VAL(VTAB$)
- 1920 IF VTAB% > 27 OR VTAB% < 1 THEN GOSUB 3500 : GOTO 1820
- 1930 PRINT
- 1940 PRINT TAB(10) "When prompted, enter:"
- 1950 PRINT TAB(13) "1) Number of spaces to the first tab, then"
- 1960 PRINT TAB(13) "2) The channel number of the tab, then"
- 1970 PRINT TAB(13) "3) The number of spaces to the next tab, etc."
- 1980 PRINT
- 1990 PRINT TAB(10) "Channel numbers can be reused, but cannot have"
- 2000 PRINT TAB(10) "a value greater than 12."
- 2010 PRINT TAB(10) "Total number of spaces cannot exceed 128."
- 2020 PRINT
- 2030 PRINT TAB(10) "Note: To access these tabs after they are set, you"
- 2040 PRINT TAB(16) "must send CHR$(11) or (^K) plus the channel number"
- 2050 PRINT TAB(16) "of the desired tab location to the printer."
- 2060 PRINT TAB(16) "Code for channel #10 = ':',#11 = ';',#12 = '<'"
- 2070 PRINT
- 2080 PRINT TAB(10); : INPUT "Press RETURN when you are ready. ",CR$
- 2090 ' ********** Begin tab sequence
- 2100 GOSUB 3610
- 2110 LPRINT DC4$
- 2120 FOR X% = 1 TO VTAB%
- 2130 PRINT
- 2140 PRINT TAB(10); : INPUT "Number of spaces to tab: ",SP$
- 2150 IF SP$ = "0" THEN 2180
- 2160 IF LEN(SP$) > 3 OR VAL(SP$) > 128 THEN GOSUB 3560 : GOTO 2140
- 2170 IF VAL(SP$) < 1 THEN GOSUB 3560 : GOTO 2140
- 2180 SP% = VAL(SP$)
- 2190 TSP% = TSP% + SP% : IF TSP% <= 128 THEN 2320
- 2200 PRINT : PRINT TAB(10) "Sorry, you entered";SP%;
- 2210 IF SP%=1 THEN PRINT "space, and the printer has no more room." : GOTO 2240
- 2220 PRINT "spaces, and the printer"
- 2230 PRINT TAB(10) "only has room left for";128+SP%-TSP%;"."
- 2240 PRINT TAB(10) "You can re-enter the number of spaces or start over."
- 2250 TSP% = TSP% - SP% : PRINT
- 2260 PRINT TAB(10) "Do you want to start over? <Y/N>"
- 2270 YN$ = INKEY$ : IF YN$ = "" THEN 2270
- 2280 IF YN$ = "Y" OR YN$ = "y" THEN 2300
- 2290 IF YN$ = "N" OR YN$ = "n" THEN PRINT:GOTO 2140:ELSE GOSUB 3560:GOTO 2260
- 2300 PRINT : PRINT TAB(10) "OK -- Turn the printer off and on and press RETURN"
- 2310 PRINT TAB(10); : INPUT "when you are ready ",CR$ : GOTO 1820
- 2320 PRINT
- 2330 PRINT TAB(10); : INPUT "Channel number of tab: ",CH$
- 2340 IF LEN(CH$) > 2 THEN GOSUB 3560 : GOTO 2330
- 2350 IF VAL(CH$) > 12 OR VAL(CH$) < 1 THEN GOSUB 3560 : GOTO 2330
- 2360 IF CH$ = "10" THEN CH$ = ":"
- 2370 IF CH$ = "11" THEN CH$ = ";"
- 2380 IF CH$ = "12" THEN CH$ = "<"
- 2390 ' ********** Send tab to printer
- 2400 LPRINT SPC(SP%);CH$
- 2410 NEXT X%
- 2420 LPRINT QU$
- 2430 ' ********** End sequence
- 2440 PRINT
- 2450 IF VTAB% = 1 THEN PRINT TAB(9) VTAB%;"vertical tab set." : GOTO 3460
- 2460 PRINT TAB(9) VTAB%;"vertical tabs set."
- 2470 GOTO 3460
- 2480 ' ********** Set page length
- 2490 GOSUB 3610
- 2500 PRINT TAB(27) "PAGE LENGTH"
- 2510 PRINT TAB(27) "-----------"
- 2520 PRINT : PRINT
- 2530 PRINT TAB(10) "1. Set page length"
- 2540 PRINT TAB(10) "2. Return control to front panel switch"
- 2550 PRINT TAB(10) "3. Return to main menu"
- 2560 GOSUB 3660
- 2570 IF S% < 1 OR S% > 3 THEN GOSUB 3500 : GOTO 2490
- 2580 ON S% GOTO 2590,2700,1440
- 2590 PRINT
- 2600 PRINT TAB(10); : INPUT "Enter page length desired (0-99 lines): ",L$
- 2610 IF L$ = "0" THEN 2640
- 2620 IF LEN(L$) > 2 THEN GOSUB 3560 : GOTO 2600
- 2630 IF VAL(L$) < 1 THEN GOSUB 3560 : GOTO 2600
- 2640 IF VAL(L$) < 10 THEN LPRINT PL$;"0";L$ : GOTO 2670
- 2650 LFTL$ = LEFT$(L$,1) : RTL$ = RIGHT$(L$,1)
- 2660 LPRINT PL$;LFTL$;RTL$
- 2670 PRINT : PRINT TAB(10) "Page length set to ";L$;
- 2680 IF L$ = "1" THEN PRINT " line" : GOTO 3460
- 2690 PRINT " lines" : GOTO 3460
- 2700 PRINT
- 2710 LPRINT PL$;"0";"0" : PRINT TAB(10) "Control returned to switch" : GOTO 3460
- 2720 '
- 2730 ' ********** Set top of form
- 2740 GOSUB 3610
- 2750 PRINT TAB(27) "TOP OF FORM"
- 2760 PRINT TAB(27) "-----------"
- 2770 PRINT : PRINT
- 2780 PRINT TAB(10) "1. Set top of form (check the paper position)"
- 2790 PRINT TAB(10) "2. Return to main menu"
- 2800 GOSUB 3660
- 2810 IF S% < 1 OR S% > 2 THEN GOSUB 3500 : GOTO 2740
- 2820 ON S% GOTO 2830,1440
- 2830 LPRINT TOF$ : PRINT
- 2840 PRINT TAB(10) "Top of form set to present position"
- 2850 GOTO 3460
- 2860 ' ********** Set characters per inch
- 2870 GOSUB 3610
- 2880 PRINT TAB(23) "CHARACTERS PER INCH"
- 2890 PRINT TAB(23) "-------------------"
- 2900 PRINT : PRINT
- 2910 PRINT TAB(10) "1. 5 characters per inch"
- 2920 PRINT TAB(10) "2. 8.3 characters per inch"
- 2930 PRINT TAB(10) "3. 10 characters per inch"
- 2940 PRINT TAB(10) "4. 16.5 characters per inch"
- 2950 PRINT TAB(10) "5. Return to main menu"
- 2960 GOSUB 3660
- 2970 IF S% < 1 OR S% > 5 THEN GOSUB 3500 : GOTO 2870
- 2980 ON S% GOTO 2990,3000,3010,3020,1440
- 2990 LPRINT RS$;US$ : GOTO 3030
- 3000 LPRINT GS$;US$ : GOTO 3030
- 3010 LPRINT RS$ : GOTO 3030
- 3020 LPRINT GS$
- 3030 A(1) = 5 : A(2) = 8.3 : A(3) = 10 : A(4) = 16.5
- 3040 PRINT : PRINT TAB(10) "Printer set to";A(S%);"characters per inch"
- 3050 GOTO 3460
- 3060 ' ********** Line length set
- 3070 GOSUB 3610
- 3080 PRINT TAB(23) "LINE LENGTH"
- 3090 PRINT TAB(23) "-----------"
- 3100 PRINT : PRINT
- 3110 PRINT TAB(10) "1. Set long line (80 char. @ 10 c.p.i.)"
- 3120 PRINT TAB(10) "2. Set short line (64 char. @ 10 c.p.i.)"
- 3130 PRINT TAB(10) "3. Return to main menu"
- 3140 GOSUB 3660
- 3150 IF S% < 1 OR S% > 3 THEN GOSUB 3500 : GOTO 3070
- 3160 ON S% GOTO 3170,3180,1440
- 3170 LPRINT LL$ : GOTO 3190
- 3180 LPRINT SL$
- 3190 PRINT : PRINT TAB(10) "Printer set to";
- 3200 IF S% = 1 THEN PRINT " long line" ELSE PRINT " short line"
- 3210 GOTO 3460
- 3220 ' ********** Printer test routine
- 3230 GOSUB 3610
- 3240 PRINT TAB(23) "PRINTER TEST"
- 3250 PRINT TAB(23) "------------"
- 3260 PRINT : PRINT
- 3270 PRINT TAB(10) "1. Execute printer test"
- 3280 PRINT TAB(10) "2. Return to main menu"
- 3290 GOSUB 3660
- 3300 IF S% < 1 OR S% > 2 THEN GOSUB 3500 : GOTO 3230
- 3310 ON S% GOTO 3320,1440
- 3320 PRINT
- 3330 PRINT TAB(10) "Do you want a form feed before the test? <Y/N>"
- 3340 YN$ = INKEY$ : IF YN$ = "" THEN 3340
- 3350 IF YN$ = "Y" OR YN$ = "y" THEN 3380
- 3360 IF YN$ = "N" OR YN$ = "n" THEN 3390
- 3370 GOSUB 3560 : GOTO 3330
- 3380 LPRINT CHR$(12)
- 3390 PRINT : PRINT TAB(10) "Type any character to stop printer test"
- 3400 FOR X% = 32 TO 126
- 3410 IF INKEY$ <> "" THEN 3460
- 3420 LPRINT CHR$(X%);
- 3430 NEXT X%
- 3440 GOTO 3400
- 3450 ' ********* Routine to return to main menu
- 3460 PRINT : PRINT
- 3470 PRINT TAB(10); : INPUT "Press RETURN for main menu ",CR$
- 3480 GOTO 1440
- 3490 ' ********** Error subroutine # 1
- 3500 CLS
- 3510 PRINT BEL$ : FOR Z% = 1 TO 6 : PRINT : NEXT
- 3520 PRINT TAB(13) "Impossible selection; please try again!"
- 3530 FOR Z% = 1 TO 1000 : NEXT
- 3540 RETURN
- 3550 ' ********** Error subroutine # 2
- 3560 PRINT CU$;EL$;BEL$;TAB(12) "Impossible selection; please try again!";
- 3570 FOR Z% = 1 TO 1000 : NEXT
- 3580 PRINT EL$;CU$
- 3590 RETURN
- 3600 ' ********** Clear screen subroutine
- 3610 CLS
- 3620 PRINT:PRINT
- 3630 RETURN
- 3640 ' ********** Wait for character entry subroutine
- 3650 '
- 3660 PRINT : PRINT
- 3670 PRINT TAB(10) "Please enter the number of your choice:"
- 3680 S$ = INKEY$ : IF S$ = "" THEN 3680
- 3690 S% = VAL(S$) : RETURN
- 3700 END
-